<%@page import="com.mconnect.msurvey.model.PriceListRecommend"%>
<%@page import="com.mconnect.msurvey.model.PriceListSurvey"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.mconnect.msurvey.model.PriceList"%>
<%@page import="java.util.List"%>
<%@page import="com.mconnect.msurvey.controller.PriceListManager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

 <style>
		body { font-size: 62.5%; }
		label, input { display:block; }
		input.text { margin-bottom:12px; width:95%; padding: .4em; }
		fieldset { padding:0; border:0; margin-top:25px; }
		h1 { font-size: 1.2em; margin: .6em 0; }
		div#users-contain1 { width: 350px; margin: 20px 0; }
		div#users-contain1 table { margin: 1em 0; border-collapse: collapse; width: 100%; }
		div#users-contain1 table td, div#users-contain1 table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
	</style>

</head>
<body>
	<% int id_plan = Integer.parseInt(request.getParameter("id_plan")); 
		PriceListManager priceController = new PriceListManager();
		List<PriceList> priceList = new ArrayList<PriceList>();
		priceList = priceController.getPriceListById_plan(id_plan);
		List<PriceListSurvey> priceSurvey = priceList.iterator().next().getResponderPriceList();
		List<PriceListRecommend> priceRecommend = priceList.iterator().next().getRecommendPriceList();
	%>
		<div id="users-contain1" class="ui-widget" style="width: 700px; ">
		<table id="users" class="ui-widget ui-widget-content" style="width: 600px; ">
			<thead>
				<tr class="ui-widget-header ">
					<th>Cena za 1 ankiete</th>
					<th colspan="2">Ilość ankiet (od - do)</th>
				</tr>
			<tbody>
				<%for(PriceListSurvey pSurvey : priceSurvey){ %>
					<tr>
						<td><%= pSurvey.getPrice1Survey() %></td>
						<td><%= pSurvey.getBegin() %></td>
						<td><%= pSurvey.getEnd() %></td>
					</tr>
				<%} %>	
			</tbody>	
		</table>
		
		<table id="users" class="ui-widget ui-widget-content" style="width: 600px; margin-top: 20px; ">
			<thead>
				<tr class="ui-widget-header ">
					<th>Cena za 1 polecenie</th>
					<th colspan="2">Ilość poleceń (od - do)</th>
				</tr>
			<tbody>
				<%for(PriceListRecommend pRecommend : priceRecommend){ %>
					<tr>
						<td><%= pRecommend.getPrice1Recommend() %></td>
						<td><%= pRecommend.getBeginRecommend() %></td>
						<td><%= pRecommend.getEndRecommend() %></td>
					</tr>
				<%} %>	
			</tbody>	
		</table>
		</div>
	
</body>	
</html>